package lc1993929.com.secret;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;

import lc1993929.com.secret.atys.AtyLogin;
import lc1993929.com.secret.atys.AtyTimeLine;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        String token = Config.getCachedToken(this);
        String phone_num = Config.getCachedPhoneNum(this);


        if (token != null && phone_num != null) {
            Intent intent = new Intent(this, AtyTimeLine.class);
            intent.putExtra(Config.KEY_TOKEN, token);
            intent.putExtra(Config.KEY_PHONE_NUM, phone_num);
            startActivity(intent);
        } else {
            startActivity(new Intent(this, AtyLogin.class));
        }
        finish();
    }
}
